clear all
global system "linux"

if "${system}" == "linux" {
	*global code "/"
	global code "/"
	global s "/"
}

run "${code}${s}_set-path.do"


**** 2. Regression
cd "${code}/tba_elig"
local flist: dir "${Estimates}" files "harp-*.ster"
foreach f of local flist {
	cap erase "${Estimates}/`f'"
}
local flist: dir "${log}" files "*"
foreach f of local flist {
	cap erase "${log}/`f'"
}

local cmd "sbatch --export=HOME,PATH,SHELL -a 1-162 HARP-reg.sh" 
di "`cmd'"

local JobIdFile "${log}/job-id.csv"  
log using `JobIdFile', name("jobid") text replace
shell `cmd'
log close _all

do _sbatch-job "`JobIdFile'" 


// create tables
cd "${code}/tba_elig"
qui do "_create-tables-harp.do"
